import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/fonts/iconfont.css'
import './assets/css/reset.css'
import {
  Button, Icon, Tabbar, TabbarItem, Swipe, SwipeItem,
  Grid, GridItem, PullRefresh, List, NavBar, GoodsAction,
  GoodsActionIcon, GoodsActionButton, Popup, Card, Stepper,
  Checkbox, SwipeCell, SubmitBar, Form, Field, ContactCard,
  AddressList, AddressEdit, Search, Lazyload
} from 'vant'
import loading from './assets/imgs/loading.webp'
// 引入一个自定义插件并使用
import $alert from './plugins'
import $loading from './plugins/Loading'
Vue.use($alert)
Vue.use($loading)

Vue.use(Button)
  .use(Icon)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(Form)
  .use(Field)
  .use(ContactCard)
  .use(AddressList)
  .use(AddressEdit)
  .use(Search)

/*
等待webpack编译之后再运行的
  */
Vue.use(Lazyload, {
  loading: loading,
  error: loading,
  preload: 1,
  attempt: 3
})
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
